// pages/tarbar/activity/index.js
const Page = require('../../../utils/ald-stat.js').Page;
const app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    block_challenge: '',
    block_lucky_draw: '',
    block_red: '',
    block_turntable: '',
    block_ad:'',
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {
    const that = this;
    var sign = app.sort_ASCII();
    wx.request({
      url: app.globalData.new_url + '/userinfo/Userinfo/activity_zone',
      data: {
        sign: sign
      },
      method: 'POST',
      success: function(res) {
        console.log(res)
        that.setData({
          block_challenge: res.data.block_challenge,
          block_lucky_draw: res.data.block_lucky_draw,
          block_red: res.data.block_red,
          block_turntable: res.data.block_turntable,
          block_ad: res.data.block_ad,
        })
      }
    })
  },

  gochallenge: function() {
    wx.navigateTo({
      url: '/pages/other/challenge/index',
    })
  },
  goredbag: function() {
    wx.navigateTo({
      url: '/pages/other/redbag/index',
    })
  },
  gozhuanpan: function() {
    wx.navigateTo({
      url: '/pages/main/turntable/index',
    })
  },
  gochou: function() {
    wx.navigateTo({
      url: '/pages/other/choujiang/index',
    })
  }, 
  goadv7: function () {
    wx.navigateToMiniProgram({
      appId: 'wxfbe9b70586c413d7',
      path: '/pages/index/index?uid=3',
      extraData: {
        foo: 'zdd'
      },
      envVersion: 'develop',
      success(res) {
        // 打开成功
        console.log('跳转成功')
      }
    })
  },
  goadv6: function () {
    wx.navigateToMiniProgram({
      appId: 'wx199ee3de577c19f2',
      path: '/pages/index/index?channelId=4336',
      extraData: {
        foo: 'zdd'
      },
      envVersion: 'develop',
      success(res) {
        // 打开成功
        console.log('跳转成功')
      }
    })
  },
  goadv5: function () {
    wx.navigateToMiniProgram({
      appId: 'wx11bf2d9a93bd8ae8',
      path: '?traceid=368&ald_media_id=23814&ald_link_key=99e08a9a1828b5fa&ald_position_id=0',
      extraData: {
        foo: 'zdd'
      },
      envVersion: 'develop',
      success(res) {
        // 打开成功
        console.log('跳转成功')
      }
    })
  },
  goadv4: function () {
    wx.navigateToMiniProgram({
      appId: 'wx7c1b71b1e308187a',
      path: '?traceid=369&ald_media_id=23817&ald_link_key=c722ab6a8e0f733a&ald_position_id=0',
      extraData: {
        foo: 'zdd'
      },
      envVersion: 'develop',
      success(res) {
        // 打开成功
        console.log('跳转成功')
      }
    })
  },
  goadv3: function () {
    wx.navigateToMiniProgram({
      appId: 'wx130cbc6374beae60',
      path: '?cpsId=zdd_2062',
      extraData: {
        foo: 'zdd'
      },
      envVersion: 'develop',
      success(res) {
        // 打开成功
        console.log('跳转成功')
      }
    })
  },
  goadv2: function () {
    wx.navigateToMiniProgram({
      appId: 'wx9bc69c33bb44dfbe',
      path: '?traceid=367&ald_media_id=23812&ald_link_key=8ce98d34f03f7e22&ald_position_id=0',
      extraData: {
        foo: 'zdd'
      },
      envVersion: 'develop',
      success(res) {
        // 打开成功
        console.log('跳转成功')
      }
    })
  },
  goadv1: function () {
    wx.navigateToMiniProgram({
      appId: 'wxb84436a41e966e09',
      path: '?from=zdd&ald_media_id=23753&ald_link_key=285095ea326bd398&ald_position_id=0',
      extraData: {
        foo: 'zdd'
      },
      envVersion: 'develop',
      success(res) {
        // 打开成功
        console.log('跳转成功')
      }
    })
  },

})